package com.xuzimian.globaldemo.quartz.job;

import com.xuzimian.globaldemo.quartz.util.SchedulerHelper;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.SchedulerException;


public class SimpleJob implements Job {



    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println("----- " + jobExecutionContext.getJobDetail().getKey().getName() + " 执行任务了 -----");
        System.out.println(this);
        try {
            SchedulerHelper.removeJob(jobExecutionContext.getJobDetail().getKey().getName(), jobExecutionContext.getJobDetail().getKey().getGroup());
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
    }


}
